package cn.zqy.demo.day05;

public class Demo02Arrray {
    public static void main(String[] args) {
        // 指定内容初始化
       /*标准格式*/
        int[] arrayA = new  int[] {1,2,3,4};
        String[] arrayB = new String[] {"Hello", "World", "Java"};
        char[] arrayC = new char[] {'q', 'w', 99, 'A', 'H'};
        System.out.println(arrayA.length);
        System.out.println(arrayC.length);
        System.out.println("====================");

        /*省略格式*/
        int[] arr1 = {1,1,1,1,1,1,1};
        System.out.println(arr1.length);

        /*拆分写法*/
        int[] arr2;
        arr2 = new int[8];
        int[] arr3;
        arr3 = new int[] {1,2,3,4,5,6,7};
        System.out.println(arr2.length);
        System.out.println(arr3.length);


        /*错误写法*/
        /*int[] arr5;
        arr5 = {1,1,1,1,}*/

    }
}
